package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.internetofthings.combustiblegas;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.internetofthings.combustiblegas.ComAlarmInfoService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * 报警日志控制器
 */
@Action
@RequestMapping(value="combustiblegas/alarmInfo")
public class ComAlarmInfoController extends BaseController {
    @Resource
    public ComAlarmInfoService comAlarmInfoService;

    /**
     * 更多报警信息列表查询
     * @param
     * @return
     */
    @At(value = "alarmInfoListPage", method = RequestMethod.GET, param = { "page","limit" })
    public RespEntity alarmInfoListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return comAlarmInfoService.alarmInfoListPage(jsonParam);
    }

    /**
     * 字典组查询（目前用到电气火灾监测报警类型的列表查询）
     * @param  groupname:字典组
     * @return
     */
    @At(value = "dictList", method = RequestMethod.GET, param = { "groupname"})
    public RespEntity dictList(@RequestBody(required = false) JSONObject jsonParam) {
        return comAlarmInfoService.dictList(jsonParam);
    }

    /**
     * 处置功能
     * @param
     * id	单位设备详细日志表的主键id
     * handlePerson	处理人员
     * infoconfirm	信息确认：1 报警 2 误报 3 测试
     * batchHandle	是否批处理：是：true  不是：false
     * handleRemark	处理备注
     * handletime	处理时间
     * number	设备编号
     * alarmType	报警类型:对应字典表报警类型
     * type	1 手动  2  自动
     * @return
     */
    @At(value = "handle", method = RequestMethod.POST, param = { "type" })
    public RespEntity handle(@RequestBody(required = false) JSONObject jsonParam) {
        return comAlarmInfoService.handle(jsonParam);
    }

    /**
     * 报警信息详情
     * @param  id:单位设备详细日志id
     * @return
     */
    @At(value = "detail", method = RequestMethod.GET, param = { "id" })
    public RespEntity detail(@RequestBody(required = false) JSONObject jsonParam) {
        return comAlarmInfoService.detail(jsonParam);
    }

    /**
     * 报警日志添加
     * @param
     * number	设备编号
     * content	报警内容
     * alarmType	报警类型:对应字典表报警类型
     * alarmtime	报警时间
     * @return
     */
    @At(value = "add", method = RequestMethod.POST)
    public RespEntity add(@RequestBody(required = false) JSONObject jsonParam) {
        return comAlarmInfoService.add(jsonParam);
    }






   
}